<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<header th:replace="admin/header::header-fragment"></header>
<body class="hold-transition sidebar-mini">
<div class="wrapper">
    <!-- Navbar -->
    <!-- 引入页面头部header-fragment -->
    <div th:replace="admin/header::header-nav"></div>
    <!-- /.navbar -->
    <!-- Main Sidebar Container -->
    <!-- 引入工具栏sidebar-fragment -->
    <div th:replace="admin/sidebar::sidebar-fragment(${path})"></div>

    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section class="content-header">
            <div class="container-fluid">
                <div class="row mb-2">
                    <div class="col-sm-6">

                    </div>
                    <div class="col-sm-6">
                    </div>
                </div>
            </div><!-- /.container-fluid -->
        </section>
        <!-- Main content -->
        <section class="content">
            <div class="row">
                <div class="col-md-12">
                    <div class="card card-outline card-info">
                        <div class="card-header">
                            <h2 th:if="${type=='add'}" class="card-title" >商品信息添加</h2>
                            <h2 th:unless="${type!='add'}" class="card-title" >商品信息编辑</h2>
                        </div>
                        <!-- /.card-header -->
                        <div class="card-body pad">
                            <form id="goodsForm" onsubmit="return false">
                                <div class="form-group" style="display:flex;">
                                    <label class="control-label">请选择分类:&nbsp;&nbsp;&nbsp;&nbsp;</label>
                                    <select class="form-control col-sm-3" id="levelOne"
                                            data-placeholder="请选择分类...">
                                        <th:block th:unless="${null == firstlevelcategories}">
                                            <th:block th:each="c:${firstlevelcategories}">
                                                <option th:value="${c.categoryId}" th:text="${c.categoryName}"
                                                th:selected="${null !=firstlevelcategoryId and firstlevelcategoryId==c.categoryId}? true:false"> </option>
                                            </th:block>
                                        </th:block>
                                    </select>&nbsp;
                                    <select class="form-control col-sm-3"
                                            id="levelTwo"
                                            data-placeholder="请选择分类...">
                                        <th:block th:unless="${null == secondlevelcategories}">
                                            <th:block th:each="c:${secondlevelcategories}">
                                                <option th:value="${c.categoryId}" th:text="${c.categoryName}"
                                                        th:selected="${null !=secondlevelcategoryId and secondlevelcategoryId==c.categoryId}? true:false">

                                                </option>
                                            </th:block>
                                        </th:block>
                                    </select>&nbsp;
                                    <select class="form-control col-sm-3"
                                            id="levelThree"
                                            data-placeholder="请选择分类...">
                                        <th:block th:unless="${null == thirdlevelcategories}">
                                            <th:block th:each="c:${thirdlevelcategories}">
                                                <option th:value="${c.categoryId}" th:text="${c.categoryName}"
                                                        th:selected="${null !=thirdlevelcategoryId and thirdlevelcategoryId==c.categoryId}? true:false">

                                                </option>
                                            </th:block>
                                        </th:block>
                                    </select>
                                </div>
                                <div class="form-group" style="display: flex">
                                    <input type="hidden" id="goodsId" name="goodsId"
                                        th:value="${goods!=null and goods.goodsId!=null}?${goods.goodsId}: 0">
                                    <input type="text" class="form-control col-sm-5" placeholder="*请输入商品名称(必填)"
                                           style="margin-right: 20px;margin-left: 85px"
                                            th:value="${goods!=null and goods.goodsName!=null}?${goods.goodsName}:''">

                                    <input type="text" class="form-control col-sm-5" placeholder="*请输入商品简介(100字以内)"
                                        th:value="${goods!=null and goods.goodsIntro!=null}?${goods.goodsIntro}: ''">
                                </div>
                                <div class="form-group " style="display: flex">

                                    <input type="number" class="form-control col-sm-5" placeholder="*请输入商品价格"
                                           style="margin-right: 20px;margin-left: 85px"
                                            th:value="${goods!=null and goods.originalPrice!=null}?${goods.originalPrice}:'*请输入商品价格'">

                                    <input type="number" class="form-control col-sm-5" placeholder="*请输入商品售卖价"
                                        th:value="${goods!=null and goods.sellPrice!=null}?${goods.sellPrice}: '*请输入商品售卖价'">
                                </div>
                                <div class="form-group" style="display: flex">
                                    <input type="number" class="form-control col-sm-5"
                                           name="stockNum" placeholder="*请输入商品库存数"
                                    style="margin-right: 20px;margin-left: 85px"
                                    th:value="${goods!=null and goods.stockNum!=null}?${goods.stockNum}: '*请输入商品库存数'">

                                    <input type="text" class="form-control col-sm-5"
                                           name="tag" id="tag" placeholder="*请输入商品小标签"
                                            th:value="${goods!=null and goods.tag!=null}?${goods.tag}: '*请输入商品小标签'">
                                </div>
                                <div class="form-group" style="margin-left: 80px">
                                    <label class="control-label">上架状态:&nbsp;</label>
                                    <input name="goodsSellStatus" type="radio" id="goodsSellStatusTrue" checked=true
                                           th:checked="${null==goods ||(null!=goods and null!=goods.goodsSellStatus and goods.goodsSellStatus==0)}?true:false" value="0"/>&nbsp;上架&nbsp;
                                    <input name="goodsSellStatus" type="radio" id="goodsSellStatusTrue"
                                            th:checked="${null==goods || (null!=goods and null!=goods.goodsSellStatus and goods.goodsSellStatus==0)}?true:false" value="1"/>&nbsp;下架&nbsp;
                                </div>
                            <div class="mb-3">
                <textarea class="textarea" placeholder="Place some text here"
                          style="width: 100%; height: 750px; font-size: 14px; line-height: 18px; border: 1px solid #dddddd; padding: 10px;"
                            th:utext="${goods!=null and goods.goodsDetailContent !=null}?${goods.goodsDetailContent}: ''">
                </textarea>
                            </div>
                            <div class="form-group">
                                <!-- 按钮 -->
                                &nbsp;<button class="btn btn-info float-right" style="margin-left: 5px;"
                                              id="confirmButton">保存商品
                                 </button>&nbsp;
                                &nbsp;<button class="btn btn-secondary float-right" style="margin-left: 5px;"
                                              id="cancelButton">返回商品列表
                                 </button>&nbsp;
                            </div>
                            </form>
                        </div>
                    </div>
                </div>
                <!-- /.col-->
            </div>
            <!-- ./row -->
        </section>
    </div>
    <footer class="main-footer">
        <strong>Copyright &copy; 2014-2019 <a href="http://adminlte.io">AdminLTE.io</a>.</strong>
        All rights reserved.
        <div class="float-right d-none d-sm-inline-block">
            <b>Version</b> 3.0.1
        </div>
    </footer>
    <!-- Control Sidebar -->
    <aside class="control-sidebar control-sidebar-dark">
        <!-- Control sidebar content goes here -->
    </aside>
</div>
<!-- ./wrapper -->
<script src="../../../admin/plugins/jquery/jquery.min.js"></script>
<!--<script src="../../../admin/plugins/jquery-ui/jquery-ui.min.js"></script>-->
<!-- Bootstrap 4 -->
<script src="../../../admin/plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
<!-- ChartJS -->
<!--<script src="../../../admin/plugins/chart.js/Chart.min.js"></script>-->
<!-- Sparkline -->
<!--<script src="../../../admin/plugins/sparklines/sparkline.js"></script>-->
<!-- JQVMap -->
<!--<script src="../../../admin/plugins/jqvmap/jquery.vmap.min.js"></script>-->
<!--<script src="../../../admin/plugins/jqvmap/maps/jquery.vmap.usa.js"></script>-->
<!-- jQuery Knob Chart -->
<!--<script src="../../../admin/plugins/jquery-knob/jquery.knob.min.js"></script>-->
<!-- daterangepicker -->
<!--<script src="../../../admin/plugins/moment/moment.min.js"></script>
<script src="../../../admin/plugins/daterangepicker/daterangepicker.js"></script>-->
<!-- Tempusdominus Bootstrap 4 -->
<!--<script src="../../../admin/plugins/tempusdominus-bootstrap-4/js/tempusdominus-bootstrap-4.min.js"></script>-->
<!-- Summernote -->
<script src="../../../admin/plugins/summernote/summernote-bs4.min.js"></script>
<!-- overlayScrollbars -->
<!--<script src="../../../admin/plugins/overlayScrollbars/js/jquery.overlayScrollbars.min.js"></script>-->
<!-- AdminLTE App -->
<script src="../../../admin/dist/js/adminlte.js"></script>
<!-- AdminLTE dashboard demo (This is only for demo purposes) -->
<!--<script src="../../../admin/dist/js/pages/dashboard.js"></script>-->
<!-- AdminLTE for demo purposes -->
<script src="../../../admin/dist/js/demo.js"></script>
<script src="../../../admin/js/newbee_mall_goods_edit.js"></script>

<script>
   /* $(function () {
        // Summernote
        $('.textarea').summernote()
    })*/
</script>
</body>
</html>
